home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / OpenGL / extensions / spec / sharpen_texture.spec < prev    next >
Encoding:
Text File  |  1996-11-11  |  8.1 KB  |  223 lines

  1. Name
  2.  
  3.     SGIS_sharpen_texture
  4.  
  5. Name Strings
  6.  
  7.     GL_SGIS_sharpen_texture
  8.  
  9. Version
  10.  
  11.     $Date: 1995/09/30 02:32:16 $ $Revision: 1.1 $
  12.  
  13. Number
  14.  
  15.     22
  16.  
  17. Dependencies
  18.  
  19.     EXT_texture is required
  20.     EXT_texture3D affects the definition of this extension
  21.     EXT_texture_object affects the definition of this extension
  22.  
  23. Overview
  24.  
  25.     This extension introduces texture magnification filters that sharpen
  26.     the resulting image by extrapolating from the level 1 image to the
  27.     level 0 image.  Sharpening can be enabled for all color channels, for
  28.     the alpha channel only, or for the red, green, and blue channels only.
  29.  
  30. New Procedures and Functions
  31.  
  32.     void SharpenTexFuncSGIS(enum target,
  33.                 sizei n,
  34.                 const float* points);
  35.  
  36.     void GetSharpenTexFuncSGIS(enum target,
  37.                    float* points);
  38.  
  39. New Tokens
  40.  
  41.     Accepted by the <param> parameter of TexParameteri and TexParameterf,
  42.     and by the <params> parameter of TexParameteriv and TexParameterfv, when
  43.     their <pname> parameter is TEXTURE_MAG_FILTER:
  44.  
  45.     LINEAR_SHARPEN_SGIS
  46.     LINEAR_SHARPEN_ALPHA_SGIS
  47.     LINEAR_SHARPEN_COLOR_SGIS
  48.  
  49.     Accepted by the <pname> parameter of GetTexParameteriv and
  50.     GetTexParameterfv:
  51.  
  52.     SHARPEN_TEXTURE_FUNC_POINTS_SGIS
  53.  
  54. Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
  55.  
  56.     None
  57.  
  58. Additions to Chapter 3 of the 1.0 Specification (Rasterization)
  59.  
  60.     GL Specification Table 3.7 is updated as follows:
  61.  
  62.     Name                Type        Legal Values
  63.     ----                ----        ------------
  64.     TEXTURE_WRAP_S            integer        CLAMP, REPEAT
  65.     TEXTURE_WRAP_T            integer        CLAMP, REPEAT
  66.     TEXTURE_WRAP_R_EXT        integer        CLAMP, REPEAT
  67.     TEXTURE_MIN_FILTER        integer        NEAREST, LINEAR,
  68.                             NEAREST_MIPMAP_NEAREST,
  69.                             NEAREST_MIPMAP_LINEAR,
  70.                             LINEAR_MIPMAP_NEAREST,
  71.                             LINEAR_MIPMAP_LINEAR,
  72.                             FILTER4_SGIS
  73.     TEXTURE_MAG_FILTER        integer        NEAREST, LINEAR,
  74.                             FILTER4_SGIS,
  75.                             LINEAR_DETAIL_SGIS,
  76.                             LINEAR_DETAIL_ALPHA_SGIS,
  77.                             LINEAR_DETAIL_COLOR_SGIS,
  78.                             LINEAR_SHARPEN_SGIS,
  79.                             LINEAR_SHARPEN_ALPHA_SGIS,
  80.                             LINEAR_SHARPEN_COLOR_SGIS
  81.     TEXTURE_BORDER_COLOR        4 floats    any 4 values in [0,1]
  82.     DETAIL_TEXTURE_LEVEL_SGIS    integer        any non-negative integer
  83.     DETAIL_TEXTURE_MODE_SGIS    integer        ADD, MODULATE
  84.  
  85.     Table 3.7: Texture parameters and their values.
  86.  
  87.     3.8.2.2 Texture magnification with sharpening
  88.  
  89.     Three additional texture magnification filters are defined for texture
  90.     magnification.  These values, which are assigned to TEXTURE_MAG_FILTER,
  91.     are LINEAR_SHARPEN_SGIS, LINEAR_SHARPEN_ALPHA_SGIS, and
  92.     LINEAR_SHARPEN_COLOR_SGIS.  All three filters sample the level 0
  93.     texture array exactly as it would be sampled with filter mode LINEAR.
  94.     If texture levels 0 and 1 are "complete", as described in the Mipmapping
  95.     portion of Section 3.8.1 (Texture Minification) of the GL Specification,
  96.     the level 1 array of the texture is also linearly sampled, just as though
  97.     mipmap minification was being performed with LOD (the level of detail
  98.     parameter) valued near 1.0.  If levels 0 and 1 are not complete, it is
  99.     as though the magnification texture filter was LINEAR.  (Although
  100.     querying the magnification filter value will return the value as
  101.     specified.)
  102.  
  103.     The texture value computed from the level 0 array (T0) and the
  104.     value computed from the level one array (T1) are combined to compute
  105.     the final texture value (T):
  106.  
  107.     T' = ((1 + F(LOD)) * T0) - (F(LOD) * T1)
  108.  
  109.          / 0      T' < 0
  110.     T = <  T'     0 <= T' <= 1
  111.          \ 1      T' > 1
  112.  
  113.     F is a function of the level-of-detail parameter LOD, which is
  114.     represented by the Greek character lambda in the GL Specification.
  115.  
  116.     The function F of level-of-detail parameter LOD is specified by
  117.     calling SharpenTexFuncSGIS with <target> set to TEXTURE_1D, TEXTURE_2D,
  118.     or TEXTURE_3D_EXT, <points> pointing at an array of pairs of floating
  119.     point values, and <n> set to the number of value pairs in <points>.  The
  120.     first value of each value pair in <points> specifies a value of LOD, and
  121.     the second value of each value pair specifies the corresponding function
  122.     value.  The order in which the points are specified is not significant.
  123.     The <n> value pairs in <points> completely specify the function,
  124.     replacing any previous specification that may have existed.
  125.  
  126.     Function F is evaluated by fitting a curve through the points
  127.     specified by SharpenTexFuncSGIS.  This curve may be linear between
  128.     adjacent points, or it may be smoothed, but it will pass exactly
  129.     through the points, limited only by the resolution of the
  130.     implementation.  The value pair with the lowest LOD value specifies
  131.     the function value F for all values of LOD less than or equal to that
  132.     pair's LOD.  Likewise, the value pair with the greatest LOD value
  133.     specifies the function value F for all values of LOD greater than or
  134.     equal to that pair's LOD.
  135.  
  136.     If the texture magnification filter is LINEAR_SHARPEN_SGIS, then both
  137.     the color and the alpha components of T are computed as described
  138.     in the equations above.  If the filter is LINEAR_SHARPEN_COLOR_SGIS,
  139.     then all components of T other than alpha are computed as described
  140.     above, and the alpha component of T is computed as if the texture
  141.     magnification filter were LINEAR.  Finally, if the filter is
  142.     LINEAR_SHARPEN_ALPHA_SGIS, the alpha component of T is computed as
  143.     described in the equations above, and all other components of T
  144.     are computed as if the texture magnification filter were LINEAR.
  145.  
  146.     Minification vs. Magnification
  147.     ------------------------------
  148.  
  149.     If the magnification filter is given by LINEAR_SHARPEN_SGIS,
  150.     LINEAR_SHARPEN_ALPHA_SGIS, or LINEAR_SHARPEN_COLOR_SGIS, and the
  151.     minification filter is given by NEAREST_MIPMAP_NEAREST or
  152.     LINEAR_MIPMAP_NEAREST, then c = 0.5.  The parameter c is used to
  153.     determine whether minification or magnification filtering is done,
  154.     as described in Section 3.8.2 of the GL Specification (Texture
  155.     Magnification).
  156.  
  157. Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
  158. and the Framebuffer)
  159.  
  160.     None
  161.  
  162. Additions to Chapter 5 of the 1.0 Specification (Special Functions)
  163.  
  164.     GetSharpenTexFuncSGIS is not included in display lists.
  165.  
  166. Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
  167.  
  168.     The number of points in the sharpen texture function specification of
  169.     a texture is queried by calling GetTexParameteriv or GetTexParameterfv
  170.     with <target> set to the target of the desired texture and <pname> set
  171.     to SHARPEN_TEXTURE_FUNC_POINTS_SGIS.  The function
  172.     GetSharpenTexFuncSGIS returns in <points> all of the points in the
  173.     sharpen texture function of texture <target>.
  174.  
  175. Additions to the GLX Specification
  176.  
  177.     None
  178.  
  179. Dependencies on EXT_texture
  180.  
  181.     EXT_texture is required.
  182.  
  183. Dependencies on EXT_texture3D
  184.  
  185.     If EXT_texture3D is not implemented, references in this specification
  186.     to TEXTURE_3D_EXT are invalid, and should be ignored.
  187.  
  188. Dependencies on EXT_texture_object
  189.  
  190.     If EXT_texture_object is implemented, the state values named
  191.  
  192.     SHARPEN_TEXTURE_FUNC_POINTS_SGIS
  193.     <SHARPEN_TEXTURE_FUNC>
  194.  
  195.     are added to the state vector of each texture object. When an attribute
  196.     set that includes texture information is popped, the bindings and
  197.     enables are first restored to their pushed values, then the bound
  198.     textures have their sharpen parameters restored to their pushed values.
  199.  
  200. Errors
  201.  
  202.     INVALID_ENUM is generated if SharpenTexFuncSGIS or
  203.     GetSharpenTexFuncSGIS parameter <target> is not TEXTURE_1D, TEXTURE_2D,
  204.     or TEXTURE_3D_EXT.
  205.  
  206.     INVALID_VALUE is generated if SharpenTexFuncSGIS parameter <n> is
  207.     negative.
  208.  
  209.     INVALID_OPERATION is generated if SharpenTexFuncSGIS or
  210.     GetSharpenTexFuncSGIS is executed between execution of Begin and the
  211.     corresponding execution to End.
  212.  
  213. New State
  214.  
  215.     Get Value                Get Command        Type        Initial Value    Attribute
  216.     ---------                -----------        ----        -------------    ---------
  217.     SHARPEN_TEXTURE_FUNC_POINTS_SGIS    GetTexParameteriv    n x Z+        2        texture
  218.     <SHARPEN_TEXTURE_FUNC>        GetSharpenTexFuncSGIS    n x m x R    {0, 0}, {4, 1}    texture
  219.  
  220. New Implementation Dependent State
  221.  
  222.     None
  223.